package com.jimmy.medical.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * @Desc: 订单用药、处方

 * @author jimmy

 * @date 2015-04-22
 */
@Entity
@Table(name = "order_medicine")
public class OrderMedicine extends AbstractEntity {
	
	/**药名*/
	@Column(name = "name")
	private String name;
	
	/**首字母*/
	@Column(name = "first_letter")
	private String firstLetter;
	
	/**数量描述*/
	@Column(name = "num")
	private String num;
	
	/**用法，如饭前*/
	@Column(name = "use_method")
	private String useMethod;
	
	/**用量，如每日3次，1次1片，连服10（天）*/
	@Column(name = "use_num")
	private String useNum;
	
	/** 对应的订单*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "order_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private Order order;
	
    /** 操作人*/
	@Column(name = "create_user")
	private String createUser;
	
	/**操作时间*/
	@Column(name = "create_time", length = 20)
	private String createTime;
	
	/** 更新人*/
	@Column(name = "update_user")
	private String updateUser;
	
	/**更新时间*/
	@Column(name = "update_time", length = 20)
	private String updateTime;


	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public String getCreateUser() {
		return createUser;
	}

	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFirstLetter() {
		return firstLetter;
	}

	public void setFirstLetter(String firstLetter) {
		this.firstLetter = firstLetter;
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public String getUseMethod() {
		return useMethod;
	}

	public void setUseMethod(String useMethod) {
		this.useMethod = useMethod;
	}

	public String getUseNum() {
		return useNum;
	}

	public void setUseNum(String useNum) {
		this.useNum = useNum;
	}


	
}
